home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2001 May / may_2001.iso / intercd / root / Html / ^CutePage / data1.cab / JsBox_Template / digit_PageletServer.JsBox.pgt < prev    next >
Encoding:
Text File  |  2000-05-12  |  1.6 KB  |  60 lines

  1. ========== Description Part Begin ==========
  2. Title = digit
  3. ProgID = PageletServer.JsBox
  4. LastUpdateTime = 36432.397500000
  5. PreviewPath = 
  6. Description = check the input is digit or not
  7. ========== Description Part End ==========
  8.  
  9. ========== Parameter Part Begin ==========
  10. CheckDigitPara = 40,Center,Submit,http://www.cutepage.com,http:,www.cutepage.com
  11. JsBoxType = 8
  12. CheckAlert = It is just accept digits.
  13. ========== Parameter Part End ==========
  14.  
  15. ========== Resource Part Begin ==========
  16. Resource Number = 0
  17. ========== Resource Part End ==========
  18.  
  19. ========== HTML Part Begin ==========
  20. Segment Number = 2
  21. Segment Position = script
  22. <script language="javascript">
  23. function numericCheck(formname, alerttext){
  24.     var nr1=document.forms[formname].content.value;
  25.     flg=0;
  26.     str="";
  27.     spc="";
  28.     arw="";
  29.     for (var i=0;i<nr1.length;i++){
  30.         cmp="0123456789"
  31.         tst=nr1.substring(i,i+1)
  32.         if (cmp.indexOf(tst)<0){
  33.             flg++;
  34.             str+=" "+tst;
  35.             spc+=tst;
  36.             arw+="^";}
  37.         else{arw+="_";}
  38.             }
  39.         if (flg!=0 || nr1==""){
  40.             if (spc.indexOf(" ")>-1) {
  41.                                         str+=" and blank";}
  42.             alert(alerttext);
  43.             return false;}
  44.     }
  45. </script>
  46. ===== Segment End =====
  47. Segment Position = cursor
  48. <script language="javascript">
  49. srctecformdigitalerttext="It is just accept digits."
  50. </script>
  51. <form name="srctecformdigit" action="http://www.cutepage.com" enctype="text/plain" method="post" onsubmit="return numericCheck('srctecformdigit',srctecformdigitalerttext)">
  52. <div align="Center">
  53. <input type="text" name="content" size=40 value="">
  54. <input type="submit" name="submit" value="Submit">
  55. </div>
  56. </form>
  57. ===== Segment End =====
  58. ========== HTML Part End ==========
  59.  
  60.